package icangyu.base.utils;

import android.graphics.BitmapFactory;

import java.util.List;

public class ImageUtils {

    public static String getPicDimen(List<String> picList,String gap){
        if(picList !=null && picList.size()>0){
            BitmapFactory.Options opt = new BitmapFactory.Options();
            opt.inJustDecodeBounds = true;
            StringBuilder builder = new StringBuilder();
            for(String item:picList){
                BitmapFactory.decodeFile(item,opt);
                builder.append("width=").append(opt.outWidth).append(",height=").append(opt.outHeight).append(gap);
            }
            if(builder.length()>=gap.length()){
                builder.delete(builder.length()-gap.length(),builder.length());
            }
            return builder.toString();
        }
        return "";
    }

}
